package com.example.spring.boot.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootRabbitmqApplication implements CommandLineRunner {


	@Autowired
	private RabbitTemplate rabbitTemplate;

	@Override
	public void run(String... args) throws Exception {
		rabbitTemplate.convertAndSend("Hello Rabbit");
	}

	public static void main(String[] args) {
		SpringApplication.run(SpringBootRabbitmqApplication.class, args);
	}

}
